home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’93 / Listen to your hack…beat / trap patches / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-18  |  714 b   |  40 lines  |  [TEXT/KAHL]

  1. #ifndef __GESTALTEQU__
  2. #include <GestaltEqu.h>
  3. #endif
  4.  
  5. #include "const.h"
  6. #include "globals.h"
  7. #include "utils.h"
  8. #include "patches.h"
  9. #include "main.h"
  10.  
  11. #include "midistuff.h"
  12.  
  13. void main(void)
  14. {
  15.     OSErr err;
  16.     
  17.     // detach ourselves
  18.     
  19.     RememberA0();
  20.     SetUpA4();
  21.     asm {
  22.         _RecoverHandle
  23.         move.l a0,-(sp)
  24.         _DetachResource
  25.     }
  26.     
  27.     // initialize variables for the midi manager
  28.     PreInitMidi();
  29.     InitGlobals();
  30.  
  31.  
  32.     PatchTrap(GetNextEvent,ToolTrap,PGetNextEvent,&gGetNextEventLink);
  33.     PatchTrap(FrameRect,ToolTrap,PFrameRect,&gFrameRectLink);
  34. //    PatchTrap(BlockMove,OSTrap,PBlockMove,&gBlockMoveLink);
  35.     PatchTrap(IconUtils,ToolTrap,PIconUtils,&gIconUtilsLink);
  36.     PatchTrap(TEKey,ToolTrap,PTEKey,&gTEKeyLink);
  37.  
  38.     RestoreA4();
  39. }
  40.